<!DOCTYPE html>
<!-- saved from url=(0084)http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4 -->
<html itemscope="" itemtype="http://schema.org/QAPage"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <title>c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow</title>
    <link rel="shortcut icon" href="http://cdn.sstatic.net/stackoverflow/img/favicon.ico?v=038622610830">
    <link rel="apple-touch-icon image_src" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png?v=fd7230a85918">
    <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://stackoverflow.com/opensearch.xml">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:domain" content="stackoverflow.com">
    <meta property="og:type" content="website">
    <meta property="og:image" itemprop="image primaryImageOfPage" content="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon@2.png?v=fde65a5a78c6">
    <meta name="twitter:title" property="og:title" itemprop="title name" content="MJPEG stream fails to open in OpenCV 2.4">
    <meta name="twitter:description" property="og:description" itemprop="description" content="I am having an issue getting OpenCV 2.4 to capture from an MJPEG stream from a Raspberry Pi, I have checked the stream URL in a browser and it seems to be working fine, however when I try to open i...">
    <meta property="og:url" content="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4">
    <link rel="canonical" href="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow.html">

    
    
    <script async="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/quant.js"></script><script async="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/beacon.js"></script><script async="" src="http://www.google-analytics.com/analytics.js"></script><script type="text/javascript" async="" src="http://static.adzerk.net/ados.js"></script><script src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/jquery.min.js"></script><style type="text/css"></style>
    <script src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/stub.en.js"></script>
    <link rel="stylesheet" type="text/css" href="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/all.css">
    
    <link rel="alternate" type="application/atom+xml" title="Feed for question &#39;MJPEG stream fails to open in OpenCV 2.4&#39;" href="http://stackoverflow.com/feeds/question/18077652">
    <script>
        
        StackExchange.ready(function () {
                
                StackExchange.using("snippets", function () {
                    StackExchange.snippets.initSnippetRenderer();
                });
                

            StackExchange.using("postValidation", function () {
                StackExchange.postValidation.initOnBlurAndSubmit($('#post-form'), 2, 'answer');
            });

            
            StackExchange.question.init({showAnswerHelp:true,totalCommentCount:0,shownCommentCount:0,highlightColor:'#F4A83D',backgroundColor:'#FFF',questionId:18077652});

            styleCode();

                StackExchange.realtime.subscribeToQuestion('1', '18077652');
            
                    });
    </script>


    <script>
        StackExchange.init({"locale":"en","stackAuthUrl":"https://stackauth.com","serverTime":1414324531,"networkMetaHostname":"meta.stackexchange.com","routeName":"Questions/Show","styleCode":true,"enableUserHovercards":true,"snippets":{"enabled":true,"domain":"stacksnippets.net"},"site":{"name":"Stack Overflow","description":"Q&A for professional and enthusiast programmers","isNoticesTabEnabled":true,"recaptchaPublicKey":"6LdchgIAAAAAAJwGpIzRQSOFaO0pU6s44Xt8aTwc","recaptchaAudioLang":"en","enableNewTagCreationWarning":true,"nonAsciiTags":true,"enableSocialMediaInSharePopup":true,"useGoogleOAuth2":true},"user":{"fkey":"b29e774b8287662957f750e240b2dc05","isAnonymous":true,"ab":{"homepage_recommended_algo":{"v":"b","g":2}}}});
        StackExchange.using.setCacheBreakers({"js/prettify-full.en.js":"1e12dfd2a642","js/moderator.en.js":"be37eaec9e9d","js/full-anon.en.js":"e6ab5f22d30f","js/full.en.js":"8e5e9350588c","js/wmd.en.js":"e8eac1b83307","js/third-party/jquery.autocomplete.min.js":"e5f01e97f7c3","js/third-party/jquery.autocomplete.min.en.js":"","js/mobile.en.js":"423d12c4f7d5","js/help.en.js":"4e7b593986f9","js/tageditor.en.js":"63052db07564","js/tageditornew.en.js":"fe44e0913c3c","js/inline-tag-editing.en.js":"1498d8619942","js/revisions.en.js":"bcfc08149db1","js/review.en.js":"b8ab6f6fa3f3","js/tagsuggestions.en.js":"7dfec0d2a2d7","js/post-validation.en.js":"9c5726ac6f72","js/explore-qlist.en.js":"ce6dbe2ac3f4","js/events.en.js":"c6cebafc0547","js/keyboard-shortcuts.en.js":"9c62336377ca","js/external-editor.en.js":"da8669de2730","js/external-editor.en.js":"da8669de2730","js/snippet-javascript.en.js":"1d51257a8f1d","js/snippet-javascript-codemirror.en.js":"7b8984b63b01"});
        StackExchange.using("gps", function() {
             StackExchange.gps.init(true);
        });
    </script>
    
        <script>
            StackExchange.ready(function () {
                $('#nav-tour').click(function () {
                    StackExchange.using("gps", function() {
                        StackExchange.gps.track("aboutpage.click", { aboutclick_location: "headermain" }, true);
                    });
                });
            });
        </script>
    
    
<script async="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/full-anon.en.js"></script><script async="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/snippet-javascript.en.js"></script><script async="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/post-validation.en.js"></script><script async="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/prettify-full.en.js"></script><script async="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/external-editor.en.js"></script></head>
<body class="question-page new-topbar" lang="">
    <noscript>&lt;div id="noscript-padding"&gt;&lt;/div&gt;</noscript>
    <div id="notify-container"></div>
    <div id="overlay-header"></div>
    <div id="custom-header"></div>
<div class="topbar">
    <div class="topbar-wrapper">
        
        <div class="js-topbar-dialog-corral">

<div class="topbar-dialog siteSwitcher-dialog dno">
    <div class="header">
        <h3><a href="http://stackoverflow.com/">current community</a></h3>
    </div>
    <div class="modal-content current-site-container">
        <ul class="current-site">
                <li>
                        <div class="related-links">
            <a href="http://chat.stackoverflow.com/" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:6 })">chat</a>
                    <a href="http://blog.stackoverflow.com/" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:7 })">blog</a>
            </div>




    <a href="http://stackoverflow.com/" class="current-site-link site-link js-gps-track" data-id="1" data-gps-track="
        site_switcher.click({ item_type:3 })">
        <div class="site-icon favicon favicon-stackoverflow" title="Stack Overflow"></div>
        Stack Overflow
    </a>

                </li>
                <li class="related-site">
                        <div class="L-shaped-icon-container">
        <span class="L-shaped-icon"></span>
    </div>

                    



    <a href="http://meta.stackoverflow.com/" class="site-link js-gps-track" data-id="552" data-gps-track="
            site.switch({ target_site:552, item_type:3 }),
        site_switcher.click({ item_type:4 })">
        <div class="site-icon favicon favicon-stackoverflowmeta" title="Meta Stack Overflow"></div>
        Meta Stack Overflow
    </a>

                </li>
                            <li class="related-site">
                        <div class="L-shaped-icon-container">
        <span class="L-shaped-icon"></span>
    </div>

                    <a class="site-link js-gps-track" href="http://careers.stackoverflow.com/?utm_source=stackoverflow.com&utm_medium=site-ui&utm_campaign=multicollider" data-gps-track="site_switcher.click({ item_type:9 })">
                        <div class="site-icon favicon favicon-careers" title="Stack Overflow Careers"></div>
                        Stack Overflow Careers
                    </a>
                </li>
        </ul>
    </div>
    
    <div class="header" id="your-communities-header">
        <h3>
your communities        </h3>
            
    </div>
    <div class="modal-content" id="your-communities-section">
            
            <div class="call-to-login">
                        <a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f18077652%2fmjpeg-stream-fails-to-open-in-opencv-2-4" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:10 })">Sign up</a>
                    or
                    <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f18077652%2fmjpeg-stream-fails-to-open-in-opencv-2-4" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:11 })">log in</a>

                    to customize your list.
            </div>
    </div>
    
    <div class="header">
        <h3><a href="http://stackexchange.com/sites">more stack exchange communities</a></h3>
    </div>
    <div class="modal-content">
            <div class="child-content"></div>
    </div>
</div>
        </div>

        <div class="network-items">
            
            <a href="http://stackexchange.com/" class="topbar-icon icon-site-switcher yes-hover js-site-switcher-button js-gps-track" data-gps-track="site_switcher.show" title="A list of all 130 Stack Exchange sites">
                <span class="hidden-text">Stack Exchange</span>
            </a>
            
        </div>

        <div class="topbar-links">
            
                <div class="links-container">
                    <span class="topbar-menu-links">
                            <a href="https://stackoverflow.com/users/signup?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f18077652%2fmjpeg-stream-fails-to-open-in-opencv-2-4" class="login-link">sign up</a>
                            <a href="https://stackoverflow.com/users/login?returnurl=http%3a%2f%2fstackoverflow.com%2fquestions%2f18077652%2fmjpeg-stream-fails-to-open-in-opencv-2-4" class="login-link">log in</a>
                            <a href="http://stackoverflow.com/tour">tour</a>

                            <a href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#" class="icon-help js-help-button" title="Help Center and other resources">
        help
        <span class="triangle"></span>
    </a>
    <div class="topbar-dialog help-dialog js-help-dialog dno">
        <div class="modal-content">
            <ul>
                                    <li>
                        <a href="http://stackoverflow.com/tour" class="js-gps-track" data-gps-track="help_popup.click({ item_type:1 })">
                            Tour
                            <span class="item-summary">
                                Start here for a quick overview of the site
                            </span>
                        </a>
                    </li>
                <li>
                    <a href="http://stackoverflow.com/help" class="js-gps-track" data-gps-track="help_popup.click({ item_type:4 })">
                        Help Center
                        <span class="item-summary">
                            Detailed answers to any questions you might have
                        </span>
                    </a>
                </li>
                    <li>
                        <a href="http://meta.stackoverflow.com/" class="js-gps-track" data-gps-track="help_popup.click({ item_type:2 })">
                            Meta
                            <span class="item-summary">
                                Discuss the workings and policies of this site
                            </span>
                        </a>
                    </li>
            </ul>
        </div>
    </div>

                            <a href="http://careers.stackoverflow.com/?utm_source=stackoverflow.com&utm_medium=site-ui&utm_campaign=anon-topbar">stack overflow careers</a>
                    </span>
                </div>

			<div class="search-container">
                <form id="search" action="http://stackoverflow.com/search" method="get" autocomplete="off">
                    <input name="q" type="text" placeholder="search" value="" tabindex="1" autocomplete="off" maxlength="240">
                </form>
			</div>
            	
        </div>      
    </div> 
</div>
<script>
    StackExchange.ready(function () { StackExchange.topbar.init(); });
</script>
    <div class="container">
        <div id="header" class="headeranon">
            <br class="cbt">
            <div id="hlogo">
                <a href="http://stackoverflow.com/">
                    Stack Overflow
                </a>
            </div>
            <div id="hmenus">
                <div class="nav mainnavs mainnavsanon">
                    <ul>
                        <li class="youarehere"><a id="nav-questions" href="http://stackoverflow.com/questions">Questions</a></li>
                        <li><a id="nav-tags" href="http://stackoverflow.com/tags">Tags</a></li>
                        <li><a id="nav-users" href="http://stackoverflow.com/users">Users</a></li>
                        <li><a id="nav-badges" href="http://stackoverflow.com/help/badges">Badges</a></li>
                        <li><a id="nav-unanswered" href="http://stackoverflow.com/unanswered">Unanswered</a></li>
                    </ul>
                </div>
                <div class="nav askquestion">
                    <ul>
                        <li>
                            <a id="nav-askquestion" href="http://stackoverflow.com/questions/ask">Ask Question</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        



        <div id="content" class="snippet-hidden">
            

<div itemscope="" itemtype="http://schema.org/Question">
	<link itemprop="image" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
			<!--googleoff: all-->

<div id="herobox-mini">
    <div id="hero-content">
        <span id="controls">
            <a href="http://stackoverflow.com/tour" id="tell-me-more" class="button">Take the 2-minute tour</a>
            <span id="close"><a title="click to dismiss">×</a></span>
        </span>
        <div id="blurb">
            Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
        </div>        
    </div>
    <script>
        $('#tell-me-more').click(function () {
            var clickSource = $("body").attr("class") + '-mini';
            if ($("body").hasClass("questions-page")) {
                clickSource = 'questionpagemini';
            } else if ($("body").hasClass("question-page")) {
                clickSource = 'questionpagemini';
            } else if ($("body").hasClass("home-page")) {
                clickSource = 'homepagemini';
            }

            StackExchange.using("gps", function () {
                StackExchange.gps.track("aboutpage.click", { aboutclick_location: clickSource } , true);
            });
        });
        $('#herobox-mini #close').click(function () {
            StackExchange.using("gps", function () {
                StackExchange.gps.track("hero.action", { hero_action_type: "close" }, true);
            });
            $.cookie("hero", "none", { path: "/", expires: 365 });
            var $hero = $("#herobox-mini");
            $hero.slideUp('fast', function () { $hero.remove(); });
            return false;
        });
    </script>
</div>
			<!--googleon: all-->
			<div id="question-header">
			<h1 itemprop="name"><a href="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow.html" class="question-hyperlink">MJPEG stream fails to open in OpenCV 2.4</a></h1>
		</div>
			<div id="mainbar">

			

<div class="question" data-questionid="18077652" id="question">

    <script>
                var ados = ados || {};ados.run = ados.run || [];
                ados.run.push(function() { ados_add_placement(22,8277,"adzerk292610352",4).setZone(43) ; });                    
            </script>
            <div class="everyonelovesstackoverflow" id="adzerk292610352">
            </div>    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input type="hidden" name="_id_" value="18077652">
    <a class="vote-up-off" title="This question shows research effort; it is useful and clear">up vote</a>
    <span itemprop="upvoteCount" class="vote-count-post ">1</span>
    <a class="vote-down-off" title="This question does not show any research effort; it is unclear or not useful">down vote</a>
    
    <a class="star-off" href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#" title="This is a favorite question (click again to undo)">favorite</a>
    <div class="favoritecount"><b>1</b></div>   

</div>

            </td>
            
<td class="postcell">
<div>
    <div class="post-text" itemprop="text">

        <p>I am having an issue getting OpenCV 2.4 to capture from an MJPEG stream from a Raspberry Pi, I have checked the stream URL in a browser and it seems to be working fine, however when I try to open it in OpenCV it seems to hang when I attempt to open it (I get neither the error or success messages on the terminal).</p>

<pre class="lang-cpp prettyprint prettyprinted"><code><span class="pln">cv</span><span class="pun">::</span><span class="typ">VideoCapture</span><span class="pln"> vcap</span><span class="pun">;</span><span class="pln">
cv</span><span class="pun">::</span><span class="typ">Mat</span><span class="pln"> raw_image</span><span class="pun">;</span><span class="pln">

</span><span class="kwd">const</span><span class="pln"> string videoStreamAddress </span><span class="pun">=</span><span class="pln"> </span><span class="str">"http://192.168.0.28:8080/?action=stream"</span><span class="pun">;</span><span class="pln">

</span><span class="kwd">if</span><span class="pun">(!</span><span class="pln">vcap</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="pln">videoStreamAddress</span><span class="pun">))</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    cout</span><span class="pun">&lt;&lt;</span><span class="str">"Error opening video stream"</span><span class="pun">&lt;&lt;</span><span class="pln">endl</span><span class="pun">;</span><span class="pln">
    </span><span class="kwd">return</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

cout</span><span class="pun">&lt;&lt;</span><span class="str">"Stream opened"</span><span class="pun">&lt;&lt;</span><span class="pln">endl</span><span class="pun">;</span></code></pre>

<p>I am using <a href="https://sourceforge.net/projects/mjpg-streamer/" rel="nofollow">MJPEG-Streamer</a> to provide the  stream.
The same code works fine when capturing form a RTSP video stream.</p>

<p>EDIT: I tried changing the JPEG quality and resolution of the images captured by <code>raspistill</code> on the Pi and I now get the message saying the stream failed to open.</p>

    </div>
    <div class="post-taglist">
        <a href="http://stackoverflow.com/questions/tagged/c%2b%2b" class="post-tag js-gps-track" title="show questions tagged &#39;c++&#39;" rel="tag">c++</a> <a href="http://stackoverflow.com/questions/tagged/opencv" class="post-tag js-gps-track" title="" rel="tag">opencv</a> <a href="http://stackoverflow.com/questions/tagged/mjpeg" class="post-tag js-gps-track" title="" rel="tag">mjpeg</a> 
    </div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">
<div class="post-menu"><a href="http://stackoverflow.com/q/18077652" title="short permalink to this question" class="short-link" id="link-post-18077652">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/18077652/edit" class="suggest-edit-post" title="">improve this question</a></div>        
    </td>
    <td align="right" class="post-signature">
<div class="user-info ">
    <div class="user-action-time">
        <a href="http://stackoverflow.com/posts/18077652/revisions" title="show all edits to this post">edited <span title="2013-08-06 11:12:56Z" class="relativetime">Aug 6 '13 at 11:12</span></a>
    </div>
    <div class="user-gravatar32">
        
    </div>
    <div class="user-details">
        <br>
        
    </div>
</div>    </td>
    <td class="post-signature owner">
        <div class="user-info ">
    <div class="user-action-time">
        asked <span title="2013-08-06 10:30:06Z" class="relativetime">Aug 6 '13 at 10:30</span>
    </div>
    <div class="user-gravatar32">
        <a href="http://stackoverflow.com/users/1888249/dan-nixon"><div class="gravatar-wrapper-32"><img src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/1fe1043c872297ac99a26042c877fcc4" alt="" width="32" height="32"></div></a>
    </div>
    <div class="user-details">
        <a href="http://stackoverflow.com/users/1888249/dan-nixon">Dan Nixon</a><br>
        <span class="reputation-score" title="reputation score " dir="ltr">108</span><span title="16 bronze badges"><span class="badge3"></span><span class="badgecount">16</span></span>
    </div>
</div>
    </td>
    </tr>
    </tbody></table>
</div>
</td>
        </tr>
                
<tr>
    <td class="votecell"></td>
    <td>
	    <div id="comments-18077652" class="comments  dno">
		    <table>
                <tbody data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true">

                        <tr><td></td><td></td></tr>
                </tbody>
		    </table>
	    </div>
            <div id="comments-link-18077652" data-rep="50" data-anon="true">

                <a class="js-add-link comments-link disabled-link " title="Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.">add a comment</a><span class="js-link-separator dno">&nbsp;|&nbsp;</span><a class="js-show-link comments-link dno" title="expand to show all comments on this post, or add one of your own" href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#" onclick=""></a>
            </div>
    </td>
</tr>        </tbody></table>
</div>

			<div id="answers">

				<a name="tab-top"></a>
				<div id="answers-header">
					<div class="subheader answers-subheader">
						<h2>
								2 Answers
                                <span style="display:none;" itemprop="answerCount">2</span>
						</h2>
						<div>
							<div id="tabs">
        <a href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4?answertab=active#tab-top" title="Answers with the latest activity first">active</a>
        <a href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4?answertab=oldest#tab-top" title="Answers in the order they were provided">oldest</a>
        <a class="youarehere" href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4?answertab=votes#tab-top" title="Answers with the highest score first">votes</a>
</div>
						</div>
					</div>    
				</div>    




  
<a name="18078279"></a>
<div id="answer-18078279" class="answer" data-answerid="18078279" itemscope="" itemtype="http://schema.org/Answer">
    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input type="hidden" name="_id_" value="18078279">
    <a class="vote-up-off" title="This answer is useful">up vote</a>
    <span itemprop="upvoteCount" class="vote-count-post ">2</span>
    <a class="vote-down-off" title="This answer is not useful">down vote</a>
    


</div>

            </td>
            


<td class="answercell">
    <div class="post-text" itemprop="text">
<p>Try adding a dummy param, that hints at the mjpeg content:</p>

<pre class="lang-cpp prettyprint prettyprinted"><code><span class="kwd">const</span><span class="pln"> string videoStreamAddress </span><span class="pun">=</span><span class="pln"> </span><span class="str">"http://192.168.0.28:8080/?action=stream&amp;amp;type=mjpg"</span><span class="pun">;</span></code></pre>
    </div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">
<div class="post-menu"><a href="http://stackoverflow.com/a/18078279" title="short permalink to this answer" class="short-link" id="link-post-18078279">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/18078279/edit" class="suggest-edit-post" title="">improve this answer</a></div>                    </td>
            


    <td align="right" class="post-signature">   
       

    <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2013-08-06 10:57:30Z" class="relativetime">Aug 6 '13 at 10:57</span>
    </div>
    <div class="user-gravatar32">
        <a href="http://stackoverflow.com/users/1508390/hitesh-vaghani"><div class="gravatar-wrapper-32"><img src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/t50i2.jpg" alt="" width="32" height="32"></div></a>
    </div>
    <div class="user-details">
        <a href="http://stackoverflow.com/users/1508390/hitesh-vaghani">Hitesh Vaghani</a><br>
        <span class="reputation-score" title="reputation score " dir="ltr">762</span><span title="3 silver badges"><span class="badge2"></span><span class="badgecount">3</span></span><span title="16 bronze badges"><span class="badge3"></span><span class="badgecount">16</span></span>
    </div>
</div>
    </td>
    </tr>
    </tbody></table>
</td>
        </tr>
        
<tr>
    <td class="votecell"></td>
    <td>
	    <div id="comments-18078279" class="comments ">
		    <table>
                <tbody data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true">



    <tr id="comment-26458195" class="comment ">
        <td>
            <table>
                <tbody>
                    <tr>
                        <td class=" comment-score">
                                &nbsp;&nbsp;
                        </td>
                        <td>
                                &nbsp;
                        </td>
                    </tr>
                </tbody>
            </table>
        </td>
        <td class="comment-text">
            <div style="display: block;" class="comment-body">
                <span class="comment-copy">Didn't seem to help, could still view it in the browser like this but still no luck in OpenCV.</span>
                –&nbsp;
                    <a href="http://stackoverflow.com/users/1888249/dan-nixon" title="108 reputation" class="comment-user owner">Dan Nixon</a>
                <span class="comment-date" dir="ltr"><a class="comment-link" href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#comment26458195_18078279"><span title="2013-08-06 11:08:10Z" class="relativetime-clean">Aug 6 '13 at 11:08</span></a></span>
                                                                            </div>
                    </td>
    </tr>
    <tr id="comment-26620674" class="comment ">
        <td>
            <table>
                <tbody>
                    <tr>
                        <td class=" comment-score">
                                &nbsp;&nbsp;
                        </td>
                        <td>
                                &nbsp;
                        </td>
                    </tr>
                </tbody>
            </table>
        </td>
        <td class="comment-text">
            <div style="display: block;" class="comment-body">
                <span class="comment-copy">Got this to work, just needed to make it look like a file extension.</span>
                –&nbsp;
                    <a href="http://stackoverflow.com/users/1888249/dan-nixon" title="108 reputation" class="comment-user owner">Dan Nixon</a>
                <span class="comment-date" dir="ltr"><a class="comment-link" href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#comment26620674_18078279"><span title="2013-08-11 09:34:25Z" class="relativetime-clean">Aug 11 '13 at 9:34</span></a></span>
                                                                            </div>
                    </td>
    </tr>
                </tbody>
		    </table>
	    </div>
            <div id="comments-link-18078279" data-rep="50" data-anon="true">

                <a class="js-add-link comments-link disabled-link " title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add a comment</a><span class="js-link-separator dno">&nbsp;|&nbsp;</span><a class="js-show-link comments-link dno" title="expand to show all comments on this post, or add one of your own" href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#" onclick=""></a>
            </div>
    </td>
</tr>    </tbody></table>
</div>
<script>
                var ados = ados || {};ados.run = ados.run || [];
                ados.run.push(function() { ados_add_placement(22,8277,"adzerk1048196314",4).setZone(44) ; });                    
            </script>
            <div class="everyonelovesstackoverflow" id="adzerk1048196314">
            </div>
  
<a name="18081194"></a>
<div id="answer-18081194" class="answer accepted-answer" data-answerid="18081194" itemscope="" itemtype="http://schema.org/Answer" itemprop="acceptedAnswer">
    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input type="hidden" name="_id_" value="18081194">
    <a class="vote-up-off" title="This answer is useful">up vote</a>
    <span itemprop="upvoteCount" class="vote-count-post ">0</span>
    <a class="vote-down-off" title="This answer is not useful">down vote</a>
    


        <span class="vote-accepted-on load-accepted-answer-date" title="loading when this answer was accepted...">accepted</span>
</div>

            </td>
            


<td class="answercell">
    <div class="post-text" itemprop="text">
<p>I found the answer, it is similar to what Hitesh suggested, I just needed to have a <code>.</code> before <code>mjpg</code> to make OpenCV think it was a URI to a file.</p>

<p>I found this in <a href="http://stackoverflow.com/questions/14204185/read-stream-from-specific-link/15487578#15487578">this</a> answer to a similar question.</p>
    </div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">
<div class="post-menu"><a href="http://stackoverflow.com/a/18081194" title="short permalink to this answer" class="short-link" id="link-post-18081194">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/18081194/edit" class="suggest-edit-post" title="">improve this answer</a></div>                    </td>
            


    <td align="right" class="post-signature owner">   
       

    <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2013-08-06 13:11:10Z" class="relativetime">Aug 6 '13 at 13:11</span>
    </div>
    <div class="user-gravatar32">
        <a href="http://stackoverflow.com/users/1888249/dan-nixon"><div class="gravatar-wrapper-32"><img src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/1fe1043c872297ac99a26042c877fcc4" alt="" width="32" height="32"></div></a>
    </div>
    <div class="user-details">
        <a href="http://stackoverflow.com/users/1888249/dan-nixon">Dan Nixon</a><br>
        <span class="reputation-score" title="reputation score " dir="ltr">108</span><span title="16 bronze badges"><span class="badge3"></span><span class="badgecount">16</span></span>
    </div>
</div>
    </td>
    </tr>
    </tbody></table>
</td>
        </tr>
        
<tr>
    <td class="votecell"></td>
    <td>
	    <div id="comments-18081194" class="comments  dno">
		    <table>
                <tbody data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true">

                        <tr><td></td><td></td></tr>
                </tbody>
		    </table>
	    </div>
            <div id="comments-link-18081194" data-rep="50" data-anon="true">

                <a class="js-add-link comments-link disabled-link " title="Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.">add a comment</a><span class="js-link-separator dno">&nbsp;|&nbsp;</span><a class="js-show-link comments-link dno" title="expand to show all comments on this post, or add one of your own" href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#" onclick=""></a>
            </div>
    </td>
</tr>    </tbody></table>
</div>
									<a name="new-answer"></a>
						<form id="post-form" action="http://stackoverflow.com/questions/18077652/answer/submit" method="post" class="post-form">
						    <input type="hidden" id="post-id" value="18077652">
                            <input type="hidden" id="qualityBanWarningShown" name="qualityBanWarningShown" value="false">
                            <input type="hidden" name="referrer" value="https://www.google.hu/">
							<h2 class="space">Your Answer</h2>



            <script>
            StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                    StackExchange.using("snippets", function () {
                        StackExchange.snippets.init();
                    });
                });
            }, "code-snippets");
        </script>
    

<script>
    StackExchange.ready(function() {
        initTagRenderer("".split(" "), "".split(" "));
       
        StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.options.snippets.enabled) {
                StackExchange.using("snippets", function() {
                    createEditor();
                });
            }
            else {
                createEditor();
            }
        });

        function createEditor() {
            prepareEditor({
                heartbeatType: 'answer',
                bindNavPrevention: true,
                postfix: "",
                    onDemand: true,
                    discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });
                

        }
    });  
</script>


<div id="post-editor" class="post-editor">

    <div style="position: relative;">     
        <div class="wmd-container">
            <div id="wmd-button-bar" class="wmd-button-bar"><ul id="wmd-button-row" class="wmd-button-row"><li id="wmd-bold-button" class="wmd-button" style="left: 0px;"><span style="background-position: 0px -20px;"></span></li><li id="wmd-italic-button" class="wmd-button" style="left: 25px;"><span style="background-position: -20px -20px;"></span></li><li id="wmd-spacer1" class="wmd-spacer" style="left: 50px;"><span style="background-position: -40px -20px;"></span></li><li id="wmd-link-button" class="wmd-button" style="left: 75px;"><span style="background-position: -40px -20px;"></span></li><li id="wmd-quote-button" class="wmd-button" style="left: 100px;"><span style="background-position: -60px -20px;"></span></li><li id="wmd-code-button" class="wmd-button" style="left: 125px;"><span style="background-position: -80px -20px;"></span></li><li id="wmd-image-button" class="wmd-button" style="left: 150px;"><span style="background-position: -100px -20px;"></span></li><li id="wmd-spacer2" class="wmd-spacer" style="left: 175px;"><span style="background-position: -120px -20px;"></span></li><li id="wmd-olist-button" class="wmd-button" style="left: 200px;"><span style="background-position: -120px -20px;"></span></li><li id="wmd-ulist-button" class="wmd-button" style="left: 225px;"><span style="background-position: -140px -20px;"></span></li><li id="wmd-heading-button" class="wmd-button" style="left: 250px;"><span style="background-position: -160px -20px;"></span></li><li id="wmd-hr-button" class="wmd-button" style="left: 275px;"><span style="background-position: -180px -20px;"></span></li><li id="wmd-spacer3" class="wmd-spacer" style="left: 300px;"><span style="background-position: -200px -20px;"></span></li><li id="wmd-undo-button" class="wmd-button" style="left: 325px;"><span style="background-position: -200px -20px;"></span></li><li id="wmd-redo-button" class="wmd-button" style="left: 350px;"><span style="background-position: -220px -20px;"></span></li></ul></div>
            <textarea id="wmd-input" class="wmd-input" name="post-text" cols="92" rows="15" tabindex="101" data-min-length=""></textarea>
        </div>
    </div>

    <div class="fl" style="margin-top: 8px; height:24px;">&nbsp;</div>
    <div id="draft-saved" class="draft-saved community-option fl" style="margin-top: 8px; height:24px; display:none;">draft saved</div>

    <div id="draft-discarded" class="draft-discarded community-option fl" style="margin-top: 8px; height:24px; display:none;">draft discarded</div>



    <div id="wmd-preview" class="wmd-preview"></div>
    <div></div>
    <div class="edit-block">
        <input id="fkey" name="fkey" type="hidden" value="b29e774b8287662957f750e240b2dc05">
        <input id="author" name="author" type="text">
    </div>
</div>
							<div style="position: relative;">
								
            <div class="form-item new-post-login">
        
                <div class="new-login-form">
                    <div class="new-login-left">
                        <h3>Sign up or <a id="login-link" href="http://stackoverflow.com/users/login?returnurl=%2fquestions%2f18077652%2fmjpeg-stream-fails-to-open-in-opencv-2-4%23new-answer">log in</a></h3>
                        <script>
                            StackExchange.ready(function () {
                                StackExchange.helpers.onClickDraftSave('#login-link');
                            });
                        </script>
                        <div class="preferred-login google-login">
                            <p><span class="icon"></span><span>Sign up using Google</span></p>
                        </div>
                        <div class="preferred-login facebook-login">
                            <p><span class="icon"></span><span>Sign up using Facebook</span></p>
                        </div>
                        <div class="preferred-login stackexchange-login">
                            <p><span class="icon"></span><span>Sign up using Stack Exchange</span></p>
                        </div>
                    </div>
                    <input type="hidden" name="manual-openid" class="manual-openid">
                    <input type="hidden" name="use-facebook" class="use-facebook" value="false">
                    <input type="hidden" name="use-google-oauth2" class="use-google-oauth2" value="false">
                    <input type="button" class="submit-openid" value="Submit" style="display:none">
                    <div class="new-login-right">
                                <h3>Post as a guest</h3>
    <div class="form-item">
        <table>
        <tbody><tr>
                    <script>
                StackExchange.ready(function () {
                    StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
                });
            </script>
            <td class="vm">
                <div>
                    <label for="display-name">Name</label>
                    <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
                </div>
                <div>
                    <label for="m-address">Email</label>
                    <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
                    <span class="edit-field-overlay">required, but not shown</span>
                </div>
            </td>
        </tr>
        </tbody></table>
    </div>

                    </div>
                </div>
            </div>
            <script>
                StackExchange.ready(
                    function () {
                        StackExchange.openid.initPostLogin('.new-post-login', '%2fquestions%2f18077652%2fmjpeg-stream-fails-to-open-in-opencv-2-4%23new-answer');
                    }
                );
            </script>
            <noscript>
                        &lt;h3&gt;Post as a guest&lt;/h3&gt;
    &lt;div class="form-item"&gt;
        &lt;table&gt;
        &lt;tr&gt;
                    &lt;script&gt;
                StackExchange.ready(function () {
                    StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
                });
            &lt;/script&gt;
            &lt;td class="vm"&gt;
                &lt;div&gt;
                    &lt;label for="display-name"&gt;Name&lt;/label&gt;
                    &lt;input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105"&gt;
                &lt;/div&gt;
                &lt;div&gt;
                    &lt;label for="m-address"&gt;Email&lt;/label&gt;
                    &lt;input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106"&gt;
                    &lt;span class="edit-field-overlay"&gt;required, but not shown&lt;/span&gt;
                &lt;/div&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;

            </noscript>
							</div>
           
															<div class="form-submit cbt">
									<input id="submit-button" type="submit" value="Post Your Answer" tabindex="110">
									<a href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#" class="discard-answer dno">discard</a>

<p class="privacy-policy-agreement">
By posting your answer, you agree to the <a href="http://stackexchange.com/legal/privacy-policy" target="_blank">privacy policy</a> and <a href="http://stackexchange.com/legal/terms-of-service" target="_blank">terms of service</a>.</p>
<input type="hidden" name="legalLinksShown" value="1">								</div>
						</form>



						<h2 class="bottom-notice" data-loc="1">
Not the answer you're looking for?							Browse other questions tagged <a href="http://stackoverflow.com/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged &#39;c++&#39;" rel="tag">c++</a> <a href="http://stackoverflow.com/questions/tagged/opencv" class="post-tag" title="show questions tagged &#39;opencv&#39;" rel="tag">opencv</a> <a href="http://stackoverflow.com/questions/tagged/mjpeg" class="post-tag" title="show questions tagged &#39;mjpeg&#39;" rel="tag">mjpeg</a>  or <a href="http://stackoverflow.com/questions/ask">ask your own question</a>.						</h2>
			</div>
		</div>
				<div id="sidebar" class="show-votes">
						    <div class="module question-stats">
			        <table id="qinfo">
			            <tbody><tr>
			                <td>
			                    <p class="label-key">asked</p>
			                </td>
			                <td style="padding-left: 10px">
			                    <p class="label-key" title="2013-08-06 10:30:06Z"><b>1 year ago</b></p>
			                </td>
			            </tr>
			            <tr>
			                <td>
			                    <p class="label-key">viewed</p>
			                </td>

			                <td style="padding-left: 10px">
			                    <p class="label-key">
			                        <b>2410 times</b>
			                    </p>
			                </td>
			            </tr>
			                <tr>
			                    <td>
			                        <p class="label-key">active</p>
			                    </td>
			                    <td style="padding-left: 10px">
			                        <p class="label-key"><b><a href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4?lastactivity" class="lastactivity-link" title="2013-08-06 13:11:10Z">1 year ago</a></b></p>
			                    </td>
			                </tr>
			        </tbody></table>
			    </div>
						
			<script>
                var ados = ados || {};ados.run = ados.run || [];
                ados.run.push(function() { ados_add_placement(22,8277,"adzerk499553993",[17,2221]).setZone(45) ; });                    
            </script>
            <div class="everyonelovesstackoverflow" id="adzerk499553993">
            </div>  
        <div id="hireme">
            <script>
window.careers_adurl="//careers.stackoverflow.com/gethired/js",window.careers_cssurl="//cdn-careers.sstatic.net/careers/gethired/sidebar.min.css?v=447a24157bc3",window.careers_leaderboardcssurl="{leaderboardcssurl}",window.careers_companycssurl="//cdn-careers.sstatic.net/careers/gethired/company",window.careers_adselector="div#hireme",StackExchange.ready(function(){$.ajax({url:"//cdn-careers.sstatic.net/careers/gethired/loader.min.js?v=4f474c757fe1",dataType:"script",cache:!0})});            </script>
            
        </div>
			  
    
            <div class="module sidebar-linked">
	<h4 id="h-linked">Linked</h4>
	<div class="linked" data-tracker="lq=1">
<div class="spacer">
	<a href="http://stackoverflow.com/q/19934833?lq=1" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes answered-accepted default">1</div>
	</a>
	<a href="http://stackoverflow.com/questions/19934833/opening-file-with-unknown-extension-mjpeg-in-opencv-python?lq=1" class="question-hyperlink">Opening file with unknown extension (Mjpeg?) in OpenCV python</a>
</div>			</div>
</div>

				<div class="module sidebar-related">
					<h4 id="h-related">Related</h4>
                    <div class="related js-gps-related-questions" data-tracker="rq=1">
                        <div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/4801933?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">5
    </div>
</a><a href="http://stackoverflow.com/questions/4801933/how-to-parse-mjpeg-http-stream-within-c?rq=1" class="question-hyperlink">How to parse MJPEG HTTP Stream within C++?</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/6022423?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">13
    </div>
</a><a href="http://stackoverflow.com/questions/6022423/mjpeg-streaming-and-decoding?rq=1" class="question-hyperlink">MJPEG streaming and decoding</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/8669865?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">9
    </div>
</a><a href="http://stackoverflow.com/questions/8669865/matlab-capturing-video-streams-mjpeg-rtsp-mpeg?rq=1" class="question-hyperlink">MATLAB - capturing video streams (MJPEG, rtsp, mpeg)</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/9197213?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">2
    </div>
</a><a href="http://stackoverflow.com/questions/9197213/mjpeg-network-stream-to-opencv-2?rq=1" class="question-hyperlink">MJPEG network stream to OpenCV 2</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/14204185?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">1
    </div>
</a><a href="http://stackoverflow.com/questions/14204185/read-stream-from-specific-link?rq=1" class="question-hyperlink">Read stream from specific link</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/21031031?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">0
    </div>
</a><a href="http://stackoverflow.com/questions/21031031/ip-camera-foscam-jpeg-streaming-in-opencv-only-reads-first-frame-from-video?rq=1" class="question-hyperlink">ip camera foscam jpeg streaming in opencv, only reads first frame from video</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/21041370?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">0
    </div>
</a><a href="http://stackoverflow.com/questions/21041370/opencv-how-to-capture-rtsp-video-stream?rq=1" class="question-hyperlink">OpenCV - how to capture rtsp video stream</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/22152639?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">1
    </div>
</a><a href="http://stackoverflow.com/questions/22152639/opencv-output-to-mjpeg-stream?rq=1" class="question-hyperlink">OpenCV output to MJPEG stream</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/24833149?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes default">0
    </div>
</a><a href="http://stackoverflow.com/questions/24833149/track-objects-in-opencv-from-incoming-mjpeg-stream?rq=1" class="question-hyperlink">Track objects in OpenCV from incoming MJPEG Stream</a>
</div>
<div class="spacer js-gps-track">
<a href="http://stackoverflow.com/q/25845219?rq=1" title="Vote score (upvotes - downvotes)">
    <div class="answer-votes answered-accepted default">1
    </div>
</a><a href="http://stackoverflow.com/questions/25845219/c-opencv-streaming-camera-video-images-mjpeg-from-socket-into-browser-windo?rq=1" class="question-hyperlink">C++/OpenCV Streaming Camera-Video/Images (MJPEG) from Socket into Browser (Windows 8.1)</a>
</div>

                    </div>
				</div>
            
<div id="hot-network-questions" class="module">
    <h4>
        <a href="http://stackexchange.com/questions?tab=hot" class="js-gps-track" data-gps-track="posts_hot_network.click({ item_type:1, location:11 })">
            Hot Network Questions
        </a>
    </h4>
    <ul>
            <li>
                <div class="favicon favicon-music" title="Musical Practice &amp; Performance Stack Exchange"></div><a href="http://music.stackexchange.com/questions/24558/what-is-tritone-substitution" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:240 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What is tritone substitution?
                </a>

            </li>
            <li>
                <div class="favicon favicon-programmers" title="Programmers Stack Exchange"></div><a href="http://programmers.stackexchange.com/questions/260710/code-that-converts-a-value-into-a-different-representation-then-converts-it-bac" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:131 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Code that converts a value into a different representation, then converts it back to where it started is bad, but how?
                </a>

            </li>
            <li>
                <div class="favicon favicon-aviation" title="Aviation Stack Exchange"></div><a href="http://aviation.stackexchange.com/questions/9243/why-dont-jets-themselves-have-a-break-apart-parachutable-escape-plan" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:528 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Why don't Jets themselves, have a break apart, parachutable escape plan?
                </a>

            </li>
            <li>
                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/209107/trying-to-convert-hrsmins-to-mins" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Trying to convert Hrs:Mins to Mins
                </a>

            </li>
            <li>
                <div class="favicon favicon-emacs" title="Emacs Stack Exchange"></div><a href="http://emacs.stackexchange.com/questions/2625/how-can-i-go-from-a-key-code-back-to-its-keyboard-equivalency" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:583 }); posts_hot_network.click({ item_type:2, location:11 })">
                    How can I go from a key 'code' back to its keyboard equivalency?
                </a>

            </li>
            <li class="dno js-hidden" style="display: list-item;">
                <div class="favicon favicon-tex" title="TeX - LaTeX Stack Exchange"></div><a href="http://tex.stackexchange.com/questions/209097/caption-formatting" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Caption Formatting
                </a>

            </li>
            <li class="dno js-hidden" style="display: list-item;">
                <div class="favicon favicon-stackoverflow" title="Stack Overflow"></div><a href="http://stackoverflow.com/questions/26570626/math-log2-precision-has-changed-in-chrome" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:1 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Math.log2 precision has changed in Chrome
                </a>

            </li>
            <li class="dno js-hidden" style="display: list-item;">
                <div class="favicon favicon-english" title="English Language &amp; Usage Stack Exchange"></div><a href="http://english.stackexchange.com/questions/204112/does-candlelight-mean-compare-side-by-side" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:97 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Does "candlelight" mean "compare side by side"?
                </a>

            </li>
            <li class="dno js-hidden" style="display: list-item;">
                <div class="favicon favicon-unix" title="Unix &amp; Linux Stack Exchange"></div><a href="http://unix.stackexchange.com/questions/164202/find-a-file-where-name-starts-with-a-capital-letter" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:106 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Find a file where name starts with a capital letter
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-cstheory" title="Theoretical Computer Science Stack Exchange"></div><a href="http://cstheory.stackexchange.com/questions/27143/most-memorable-cs-paper-titles" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:114 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Most memorable CS paper titles
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-moderators" title="Moderators Stack Exchange"></div><a href="http://moderators.stackexchange.com/questions/820/i-made-an-official-statement-in-good-faith-that-turned-out-to-be-wrong-should-i" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:571 }); posts_hot_network.click({ item_type:2, location:11 })">
                    I made an official statement in good faith that turned out to be wrong; should I apologize?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-askubuntu" title="Ask Ubuntu"></div><a href="http://askubuntu.com/questions/540937/what-does-apt-get-install-do-under-the-hood" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:89 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What does apt-get install do under the hood?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-superuser" title="Super User"></div><a href="http://superuser.com/questions/828722/can-a-7-days-full-100-cpu-load-burn-in-stress-test-damage-a-modern-notebo" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:3 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Can a 7 days full 100% CPU load "burn-in" / "stress test" damage a modern notebook?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-rpg" title="Role-playing Games Stack Exchange"></div><a href="http://rpg.stackexchange.com/questions/49882/how-to-deal-with-player-macgyver-ism" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:122 }); posts_hot_network.click({ item_type:2, location:11 })">
                    How to deal with player MacGyver-ism?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-codereview" title="Code Review Stack Exchange"></div><a href="http://codereview.stackexchange.com/questions/67963/trading-card-game-database-schema-for-statistics" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:196 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Trading Card Game database schema for statistics
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-diy" title="Home Improvement Stack Exchange"></div><a href="http://diy.stackexchange.com/questions/51818/plywood-joists-above-weight-bearing-wall" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:73 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Plywood joists above weight bearing wall?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-stats" title="Cross Validated"></div><a href="http://stats.stackexchange.com/questions/121438/what-is-a-log-odds-distribution" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:65 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What is a log-odds distribution?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-mathematica" title="Mathematica Stack Exchange"></div><a href="http://mathematica.stackexchange.com/questions/64118/unexpected-integration-constant" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:387 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Unexpected Integration Constant
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-codereview" title="Code Review Stack Exchange"></div><a href="http://codereview.stackexchange.com/questions/67965/count-all-unique-subsets-with-sum-s" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:196 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Count all unique subsets with Sum S
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-blender" title="Blender Stack Exchange"></div><a href="http://blender.stackexchange.com/questions/18208/can-you-add-more-loop-subdivides-later" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:502 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Can you add more loop subdivides later?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-superuser" title="Super User"></div><a href="http://superuser.com/questions/829304/do-hard-drives-really-have-open-cases-now" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:3 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Do hard drives really have open cases now?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-gaming" title="Arqade"></div><a href="http://gaming.stackexchange.com/questions/189215/what-is-the-max-amount-of-achievements-i-can-get-by-performing-any-one-action" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:41 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What is the max amount of achievements I can get by performing any one action?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-music" title="Musical Practice &amp; Performance Stack Exchange"></div><a href="http://music.stackexchange.com/questions/24486/what-kind-of-a-guitar-can-i-play-without-thumbs" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:240 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What kind of a guitar can I play without thumbs?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-space" title="Space Exploration Stack Exchange"></div><a href="http://space.stackexchange.com/questions/5710/what-are-the-challenges-of-turning-a-rocket-stage-around-and-firing-its-engines" class="js-gps-track" data-gps-track="site.switch({ item_type:11, target_site:508 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What are the challenges of turning a rocket stage around and firing its engines into a supersonic wind?
                </a>

            </li>
    </ul>

        <a href="http://stackoverflow.com/questions/18077652/mjpeg-stream-fails-to-open-in-opencv-2-4#" class="show-more js-show-more js-gps-track" data-gps-track="posts_hot_network.click({ item_type:3, location:11 })">
            more hot questions
        </a>
</div>
		</div>
	
<div id="feed-link">
    <div id="feed-link-text">
        <a href="http://stackoverflow.com/feeds/question/18077652" title="feed of this question and its answers">
            <span class="feed-icon"></span>question feed
        </a>
    </div>
</div>	<script>
StackExchange.ready(function(){$.get('/posts/18077652/ivc/7075');});
</script>
<noscript>
    &lt;div&gt;&lt;img src="/posts/18077652/ivc/7075" class="dno" alt="" width="0" height="0"&gt;&lt;/div&gt;
</noscript><div style="display:none" id="prettify-lang">lang-cpp</div></div>



        </div>
    </div>
    <div id="footer" class="categories">
        <div class="footerwrap">
            <div id="footer-menu">
                <div class="top-footer-links">
                        <a href="http://stackoverflow.com/tour">tour</a>
                    <a href="http://stackoverflow.com/help">help</a>
                        <a href="http://stackoverflow.com/help/badges">badges</a>
                    <a href="http://blog.stackoverflow.com/?blb=1">blog</a>
                        <a href="http://chat.stackoverflow.com/">chat</a>
                    <a href="http://data.stackexchange.com/">data</a>
                    <a href="http://stackexchange.com/legal">legal</a>
                    <a href="http://stackexchange.com/legal/privacy-policy">privacy policy</a>
                    <a href="http://stackexchange.com/work-here">work here</a>
                    <a href="http://stackexchange.com/mediakit">advertising info</a>

                    <a onclick="StackExchange.switchMobile(&quot;on&quot;)">mobile</a>
                    <b><a href="http://stackoverflow.com/contact">contact us</a></b>
                        <b><a href="http://meta.stackoverflow.com/">feedback</a></b>
                    
                </div>
                <div id="footer-sites">
                    <table>
    <tbody><tr>
            <th colspan="3">
                Technology
            </th>
            <th>
                Life / Arts
            </th>
            <th>
                Culture / Recreation
            </th>
            <th>
                Science
            </th>
            <th>
                Other
            </th>
    </tr>
    <tr>
            <td>
                <ol>
                        <li><a href="http://stackoverflow.com/" title="professional and enthusiast programmers">Stack Overflow</a></li>
                        <li><a href="http://serverfault.com/" title="professional system and network administrators">Server Fault</a></li>
                        <li><a href="http://superuser.com/" title="computer enthusiasts and power users">Super User</a></li>
                        <li><a href="http://webapps.stackexchange.com/" title="power users of web applications">Web Applications</a></li>
                        <li><a href="http://askubuntu.com/" title="Ubuntu users and developers">Ask Ubuntu</a></li>
                        <li><a href="http://webmasters.stackexchange.com/" title="pro webmasters">Webmasters</a></li>
                        <li><a href="http://gamedev.stackexchange.com/" title="professional and independent game developers">Game Development</a></li>
                        <li><a href="http://tex.stackexchange.com/" title="users of TeX, LaTeX, ConTeXt, and related typesetting systems">TeX - LaTeX</a></li>
                            </ol></td><td><ol>
                        <li><a href="http://programmers.stackexchange.com/" title="professional programmers interested in conceptual questions about software development">Programmers</a></li>
                        <li><a href="http://unix.stackexchange.com/" title="users of Linux, FreeBSD and other Un*x-like operating systems.">Unix &amp; Linux</a></li>
                        <li><a href="http://apple.stackexchange.com/" title="power users of Apple hardware and software">Ask Different (Apple)</a></li>
                        <li><a href="http://wordpress.stackexchange.com/" title="WordPress developers and administrators">WordPress Development</a></li>
                        <li><a href="http://gis.stackexchange.com/" title="cartographers, geographers and GIS professionals">Geographic Information Systems</a></li>
                        <li><a href="http://electronics.stackexchange.com/" title="electronics and electrical engineering professionals, students, and enthusiasts">Electrical Engineering</a></li>
                        <li><a href="http://android.stackexchange.com/" title="enthusiasts and power users of the Android operating system">Android Enthusiasts</a></li>
                        <li><a href="http://security.stackexchange.com/" title="Information security professionals">Information Security</a></li>
                            </ol></td><td><ol>
                        <li><a href="http://dba.stackexchange.com/" title="database professionals who wish to improve their database skills and learn from others in the community">Database Administrators</a></li>
                        <li><a href="http://drupal.stackexchange.com/" title="Drupal developers and administrators">Drupal Answers</a></li>
                        <li><a href="http://sharepoint.stackexchange.com/" title="SharePoint enthusiasts">SharePoint</a></li>
                        <li><a href="http://ux.stackexchange.com/" title="user experience researchers and experts">User Experience</a></li>
                        <li><a href="http://mathematica.stackexchange.com/" title="users of Mathematica">Mathematica</a></li>
                        <li><a href="http://salesforce.stackexchange.com/" title="Salesforce administrators, implementation experts, developers and anybody in-between">Salesforce</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#technology" class="more">
                                more (13)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://photo.stackexchange.com/" title="professional, enthusiast and amateur photographers">Photography</a></li>
                        <li><a href="http://scifi.stackexchange.com/" title="science fiction and fantasy enthusiasts">Science Fiction &amp; Fantasy</a></li>
                        <li><a href="http://graphicdesign.stackexchange.com/" title="Graphic Design professionals, students, and enthusiasts">Graphic Design</a></li>
                        <li><a href="http://cooking.stackexchange.com/" title="professional and amateur chefs">Seasoned Advice (cooking)</a></li>
                        <li><a href="http://diy.stackexchange.com/" title="contractors and serious DIYers">Home Improvement</a></li>
                        <li><a href="http://money.stackexchange.com/" title="people who want to be financially literate">Personal Finance &amp; Money</a></li>
                        <li><a href="http://academia.stackexchange.com/" title="academics and those enrolled in higher education">Academia</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#lifearts" class="more">
                                more (10)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://english.stackexchange.com/" title="linguists, etymologists, and serious English language enthusiasts">English Language &amp; Usage</a></li>
                        <li><a href="http://skeptics.stackexchange.com/" title="scientific skepticism">Skeptics</a></li>
                        <li><a href="http://judaism.stackexchange.com/" title="those who base their lives on Jewish law and tradition and anyone interested in learning more">Mi Yodeya (Judaism)</a></li>
                        <li><a href="http://travel.stackexchange.com/" title="road warriors and seasoned travelers">Travel</a></li>
                        <li><a href="http://christianity.stackexchange.com/" title="committed Christians, experts in Christianity and those interested in learning more">Christianity</a></li>
                        <li><a href="http://gaming.stackexchange.com/" title="passionate videogamers on all platforms">Arqade (gaming)</a></li>
                        <li><a href="http://bicycles.stackexchange.com/" title="people who build and repair bicycles, people who train cycling, or commute on bicycles">Bicycles</a></li>
                        <li><a href="http://rpg.stackexchange.com/" title="gamemasters and players of tabletop, paper-and-pencil role-playing games">Role-playing Games</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#culturerecreation" class="more">
                                more (21)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://math.stackexchange.com/" title="people studying math at any level and professionals in related fields">Mathematics</a></li>
                        <li><a href="http://stats.stackexchange.com/" title="people interested in statistics, machine learning, data analysis, data mining, and data visualization">Cross Validated (stats)</a></li>
                        <li><a href="http://cstheory.stackexchange.com/" title="theoretical computer scientists and researchers in related fields">Theoretical Computer Science</a></li>
                        <li><a href="http://physics.stackexchange.com/" title="active researchers, academics and students of physics">Physics</a></li>
                        <li><a href="http://mathoverflow.net/" title="professional mathematicians">MathOverflow</a></li>
                    
                        <li>
                            <a href="http://stackexchange.com/sites#science" class="more">
                                more (7)
                            </a>
                        </li>
                </ol>
            </td>
            <td>
                <ol>
                        <li><a href="http://stackapps.com/" title="apps, scripts, and development with the Stack Exchange API">Stack Apps</a></li>
                        <li><a href="http://meta.stackexchange.com/" title="meta-discussion of the Stack Exchange family of Q&amp;A websites">Meta Stack Exchange</a></li>
                        <li><a href="http://area51.stackexchange.com/" title="proposing new sites in the Stack Exchange network">Area 51</a></li>
                        <li><a href="http://careers.stackoverflow.com/?utm_source=stackoverflow.com&utm_medium=site-ui&utm_campaign=footerlink">Stack Overflow Careers</a></li>
                    
                </ol>
            </td>
    </tr>
</tbody></table>
                </div>
            </div>

            <div id="copyright">
                site design / logo © 2014 stack exchange inc; user contributions licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">cc by-sa 3.0</a>                   with <a href="http://blog.stackoverflow.com/2009/06/attribution-required/" rel="license">attribution required</a>
            </div>
            <div id="svnrev">
                rev 2014.10.25.1965
            </div>
            
        </div>
    <iframe id="global-auth-frame" style="display:none" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/read.html"></iframe></div>
    <noscript>
        &lt;div id="noscript-warning"&gt;Stack Overflow works best with JavaScript enabled&lt;img src="http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno"&gt;&lt;/div&gt;
    </noscript>
<script>var p = "http", d = "static"; if (document.location.protocol == "https:") { p += "s"; d = "engine"; } var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = p + "://" + d + ".adzerk.net/ados.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script>
<script>
    var ados = ados || {};
    ados.run = ados.run || [];
    ados.run.push(function () { ados_setKeywords('c%2b%2b,opencv,mjpeg');; ados_load(); });         
</script>

    <script>
        (function (i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o),
            m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m);
        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
        ga('create', 'UA-5620270-1');        
        
        ga('set', 'dimension2', '|c++|opencv|mjpeg|');         
        ga('send', 'pageview');
        var _qevents = _qevents || [],
            _comscore = _comscore || [];
        (function () {
            var ssl='https:'==document.location.protocol,
                s=document.getElementsByTagName('script')[0],
                qc=document.createElement('script');
            qc.async=true;
            qc.src=(ssl?'https://secure':'http://edge')+'.quantserve.com/quant.js';
            s.parentNode.insertBefore(qc, s);
            var sc=document.createElement('script');
            sc.async=true;
            sc.src=(ssl?'https://sb':'http://b') + '.scorecardresearch.com/beacon.js';
            s.parentNode.insertBefore(sc, s);
        })();
        _comscore.push({ c1: "2", c2: "17440561" });
        _qevents.push({ qacct: "p-c1rF4kxgLUzNc" });
    </script>        
    
    
<div id="woo_head" class="woo_content" style="display:none;"><script type="text/html" id="L-template"><iframe id="L-margin" name="L-margin"  class="woo_content_container woo_main_content" src="chrome-extension://hlngmmdolgbdnnimbmblfhhndibdipaf/images/loader.gif" style="display: block !important;"><p>Iframes not supported.</p></iframe></script><iframe id="L-margin" name="L-margin" class="woo_content_container woo_main_content" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/loader.html" style="display: block !important;">&lt;p&gt;Iframes not supported.&lt;/p&gt;</iframe><div id="woo_projected" class="woo_content_trigger hide_txt"><span style="display:none;"><em style="font-size:11px; font-style:normal; font-weight:bold;line-height:26px;text-indent:0;text-decoration:none;overflow:hidden;color:#fff;float:left;position:absolute;text-align:center;left:1px;top:0px;height:25px;width:22px;"></em></span><span class="loader L-loader" style="display:none;"><img class="" src="./c++ - MJPEG stream fails to open in OpenCV 2.4 - Stack Overflow_files/loader.html"></span><div id="woo_initiate" class="trigger_ctrl"><a id="clickable" href="javascript:void(0);" class="hide_txt" style="display:none;">Trigger</a></div></div><div class="woo_controllers upper_header"><a id="woo_hide" href="Javascript:void(0)" class="hide_margin hide_txt" title="Hide"><span style="background-image:url(chrome-extension://hlngmmdolgbdnnimbmblfhhndibdipaf/images/woo-cancel.png)">x</span></a></div></div></body></html>